package org.jsets.fastboot.model;

/**
 * 
 * 基本响应
 *
 * @author wangjie (https://github.com/wj596)
 * @date 2021.07.10 21:57
 * @since 0.1
 * 
 * 
 */
public class BaseResp extends Respond {

	private static final long serialVersionUID = 1L;
	
	public static BaseResp ok() {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(true);
		return baseReturn;
	}

	public static BaseResp ok(String message) {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(true);
		baseReturn.setMessage(message);
		return baseReturn;
	}
	
	public static BaseResp ok(Integer code, String message) {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(true);
		baseReturn.setCode(code);
		baseReturn.setMessage(message);
		return baseReturn;
	}

	public static BaseResp fail() {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(false);
		return baseReturn;
	}

	public static BaseResp fail(String message) {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(false);
		baseReturn.setMessage(message);
		return baseReturn;
	}
	
	public static BaseResp fail(Integer code, String message) {
		BaseResp baseReturn = new BaseResp();
		baseReturn.setSucceed(false);
		baseReturn.setCode(code);
		baseReturn.setMessage(message);
		return baseReturn;
	}

}